import java.io.*;
public class dif {

	public static void main(String[] args) throws Exception{
		if(args.length<2)
			System.exit(0);
		System.out.println(comp(args));
	}
	
	static boolean comp(String[] args) throws Exception{
		if(args[0].equals(args[1]))
			return false;
		int barrlen=10000;
		FileInputStream fis1 = new FileInputStream(args[0]);
		FileInputStream fis2 = new FileInputStream(args[1]);
		try {
			int i,j,k=0;
			byte[] barr1= new byte[barrlen];
			byte[] barr2= new byte[barrlen];
			while((i=fis1.read(barr1))==(j=fis2.read(barr2))){
				k++;
				if(i==-1 || j==-1){
					break;
				}
				
				for(int m=0;m<i;m++){
					if(barr1[m]!=barr2[m]){
						return false;
					}
				}
			}
			if(i==-1 && j==-1){
				return true;
			}
			return false;
		} finally {
			fis1.close();
			fis2.close(); 
		}
	}

}
